error

fun <T> error(storedVal: T, error: String): ValidationResult<T>

Create a validation result with this if there was a problem during validation.

In this case, typically, storedVal will be the default value associated with this validation. A valid instance of T must always be passed back. Add a descriptive error message to error. If there is no default, you will want to make your result type nullable and pass back null

Return

the errored ValidationResult

Author

fzzyhmstrs

Since

0.1.0

Parameters

T

Type of result

storedVal

default or fallback instance of type T

error

string with error message